<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 商品库存预警 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\StockWarning.name", default="fa_stock_warning"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\StockWarning.poolName"))
 * @DDL(sql="CREATE TABLE `fa_stock_warning` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `goods_id` int(10) NOT NULL DEFAULT '0' COMMENT '商品',
  `goods_sku_price_id` int(10) NOT NULL DEFAULT '0' COMMENT '规格',
  `goods_sku_text` varchar(255) DEFAULT NULL COMMENT '中文规格',
  `stock_warning` int(11) DEFAULT '0' COMMENT '预警值',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品库存预警'", decode="")
 *
 * @property int|null $id 
 * @property int|null $goodsId 商品
 * @property int|null $goodsSkuPriceId 规格
 * @property string|null $goodsSkuText 中文规格
 * @property int|null $stockWarning 预警值
 * @property int|null $createtime 创建时间
 * @property int|null $updatetime 更新时间
 * @property int|null $deletetime 删除时间
 */
abstract class StockWarningBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=11, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 商品.
     * goods_id
     * @Column(name="goods_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $goodsId = 0;

    /**
     * 获取 goodsId - 商品.
     *
     * @return int|null
     */
    public function getGoodsId(): ?int
    {
        return $this->goodsId;
    }

    /**
     * 赋值 goodsId - 商品.
     * @param int|null $goodsId goods_id
     * @return static
     */
    public function setGoodsId($goodsId)
    {
        $this->goodsId = null === $goodsId ? null : (int)$goodsId;
        return $this;
    }

    /**
     * 规格.
     * goods_sku_price_id
     * @Column(name="goods_sku_price_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $goodsSkuPriceId = 0;

    /**
     * 获取 goodsSkuPriceId - 规格.
     *
     * @return int|null
     */
    public function getGoodsSkuPriceId(): ?int
    {
        return $this->goodsSkuPriceId;
    }

    /**
     * 赋值 goodsSkuPriceId - 规格.
     * @param int|null $goodsSkuPriceId goods_sku_price_id
     * @return static
     */
    public function setGoodsSkuPriceId($goodsSkuPriceId)
    {
        $this->goodsSkuPriceId = null === $goodsSkuPriceId ? null : (int)$goodsSkuPriceId;
        return $this;
    }

    /**
     * 中文规格.
     * goods_sku_text
     * @Column(name="goods_sku_text", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $goodsSkuText = NULL;

    /**
     * 获取 goodsSkuText - 中文规格.
     *
     * @return string|null
     */
    public function getGoodsSkuText(): ?string
    {
        return $this->goodsSkuText;
    }

    /**
     * 赋值 goodsSkuText - 中文规格.
     * @param string|null $goodsSkuText goods_sku_text
     * @return static
     */
    public function setGoodsSkuText($goodsSkuText)
    {
        $this->goodsSkuText = null === $goodsSkuText ? null : (string)$goodsSkuText;
        return $this;
    }

    /**
     * 预警值.
     * stock_warning
     * @Column(name="stock_warning", type="int", length=11, accuracy=0, nullable=true, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $stockWarning = 0;

    /**
     * 获取 stockWarning - 预警值.
     *
     * @return int|null
     */
    public function getStockWarning(): ?int
    {
        return $this->stockWarning;
    }

    /**
     * 赋值 stockWarning - 预警值.
     * @param int|null $stockWarning stock_warning
     * @return static
     */
    public function setStockWarning($stockWarning)
    {
        $this->stockWarning = null === $stockWarning ? null : (int)$stockWarning;
        return $this;
    }

    /**
     * 创建时间.
     * createtime
     * @Column(name="createtime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 创建时间.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 更新时间.
     * updatetime
     * @Column(name="updatetime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $updatetime = NULL;

    /**
     * 获取 updatetime - 更新时间.
     *
     * @return int|null
     */
    public function getUpdatetime(): ?int
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间.
     * @param int|null $updatetime updatetime
     * @return static
     */
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = null === $updatetime ? null : (int)$updatetime;
        return $this;
    }

    /**
     * 删除时间.
     * deletetime
     * @Column(name="deletetime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $deletetime = NULL;

    /**
     * 获取 deletetime - 删除时间.
     *
     * @return int|null
     */
    public function getDeletetime(): ?int
    {
        return $this->deletetime;
    }

    /**
     * 赋值 deletetime - 删除时间.
     * @param int|null $deletetime deletetime
     * @return static
     */
    public function setDeletetime($deletetime)
    {
        $this->deletetime = null === $deletetime ? null : (int)$deletetime;
        return $this;
    }

}
